/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.games.epkb.entityClasses;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author plebani
 */
@Entity
@Table(name = "cpu_core_power")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CpuCorePower.findAll", query = "SELECT c FROM CpuCorePower c"),
    @NamedQuery(name = "CpuCorePower.findById", query = "SELECT c FROM CpuCorePower c WHERE c.id = :id"),
    @NamedQuery(name = "CpuCorePower.findByFrequncy", query = "SELECT c FROM CpuCorePower c WHERE c.frequncy = :frequncy"),
    @NamedQuery(name = "CpuCorePower.findByPower", query = "SELECT c FROM CpuCorePower c WHERE c.power = :power")})
public class CpuCorePower implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Column(name = "Frequncy")
    private String frequncy;
    @Column(name = "Power")
    private String power;
    @JoinColumn(name = "Id_CPU", referencedColumnName = "ID")
    @ManyToOne
    private Cpu idCPU;
    @JoinColumn(name = "Id_Core", referencedColumnName = "ID")
    @ManyToOne
    private CpuCore idCore;

    public CpuCorePower() {
    }

    public CpuCorePower(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getFrequncy() {
        return frequncy;
    }

    public void setFrequncy(String frequncy) {
        this.frequncy = frequncy;
    }

    public String getPower() {
        return power;
    }

    public void setPower(String power) {
        this.power = power;
    }

    public Cpu getIdCPU() {
        return idCPU;
    }

    public void setIdCPU(Cpu idCPU) {
        this.idCPU = idCPU;
    }

    public CpuCore getIdCore() {
        return idCore;
    }

    public void setIdCore(CpuCore idCore) {
        this.idCore = idCore;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CpuCorePower)) {
            return false;
        }
        CpuCorePower other = (CpuCorePower) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "it.polimi.games.epkb.entityClasses.CpuCorePower[ id=" + id + " ]";
    }
    
}
